<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:body>
	<p:dialog appendToBody="true" header="Consulta de Bens"
		widgetVar="dlgConsultaBens" modal="true" height="380"
		style="font-size: 12px;">
		<h:form id="formConsultaBens">
			<div style="border: 1px solid;">
				<h:panelGrid columns="2">
					<h:panelGrid columns="1" style="margin-left: 83px;">
						<p:selectOneMenu value="#{bemModalPesquisaTela.valorCombo}">
							<f:selectItem itemLabel="#{message.msg_descri}"
								itemValue="DESCRICAO" />
							<f:selectItem itemLabel="#{message.msg_codigo}"
								itemValue="CODIGO" />
						</p:selectOneMenu>
					</h:panelGrid>

					<h:panelGrid columns="1" style="margin-left: 27px;">
						<p:commandButton icon="ui-icon-search"
							style="margin-left: 8px; height:25px;width:25px;vertical-align: top;"
							action="#{bemModalPesquisaTela.pesquisarBem}" update="bemTable">
							<p:inputText size="30" value="#{bemModalPesquisaTela.descricao}" />
						</p:commandButton>
					</h:panelGrid>
				</h:panelGrid>
			</div>
			<div style="margin-top: 10px;">
				<p:dataTable id="bemTable" var="bem" rows="10" paginator="true"
					paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					value="#{bemModalPesquisaTela.listaBens}"
					emptyMessage="#{message.msg_semvalores}" selectionMode="single"
					selection="#{solicitacaoManutencaoTela.bemSelecionado}">
					<p:ajax event="rowSelect" oncomplete="dlgConsultaBens.hide();"
						update=":cadSSForm:inputBem,@this"
						listener="#{solicitacaoManutencaoTela.onSelectBem}" />
					<p:column headerText="#{message.msg_codigo}">#{bem.codigo}</p:column>
					<p:column headerText="#{message.msg_loja}">#{bem.descricao}</p:column>
				</p:dataTable>

			</div>
		</h:form>
	</p:dialog>
</h:body>
</html>

